from flask import Flask, request, jsonify, make_response
import os
import uuid
from flask_cors import CORS

app = Flask(__name__)
CORS(app)


@app.route('/upload', methods=['POST'])

def upload_file():
    file = request.files['file']
    file_id = str(uuid.uuid4())
    file_path = os.path.join('uploads',file.filename)
    file.save(file_path)
    return make_response(jsonify({
        'file_id': file_id,
        'message': 'File uploaded successfully',
        'status_code': 200
    }),200)
